import React, { useState } from 'react'

export default function App() {
  // console.log('app')

  let [count, setCount] = useState({ num: 0 })

  const handleClick = () => {
    setCount((count) => {
      console.log(count)
      return {
        num: 100
      }
    })
  }

  return (
    <div>
      {count.num}
      <button onClick={handleClick}>click</button>
    </div>
  )
}